﻿using System;
using System.Windows;
using SolidWorks.Interop.sldworks;
using SwAssem.Plugin;
using System.Drawing;


namespace SwAssem
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Closed(object sender, EventArgs e)
        {
            _singleUI = null;
        }


        private static MainWindow _singleUI = null;
        private SldWorks Swapp { get; set; }

        public static void Show_MainWindow(SldWorks _swapp)
        {
            if(_singleUI == null)
            {
                _singleUI = new MainWindow();
                _singleUI.Swapp = _swapp;
                
                _singleUI.Show();
            }else
            {
                _singleUI.Activate();
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Init();
        }

    }
}
